package com.lingyun.financialmanagement.controller;

import com.lingyun.financialmanagement.service.LoginService;
import com.lingyun.financialmanagement.service.pojo.LoginServiceImpl;
import com.lingyun.financialmanagement.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("login")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("login")
    public Result login(@RequestParam String account, @RequestParam String password, @RequestParam Boolean remember) {
        return loginService.login(account, password, remember);
    }


    @PostMapping("logout")
    public Result logout() {
        return loginService.logout();
    }
}
